Skip to content

Runs: say how each run was started and by whom (trigger on the runs API) - #335

Merged
nambok merged 1 commit into
mainfrom
ui/run-trigger-source
Oct 27, 2026
Merged

nambok merged 1 commit into
mainfrom
ui/run-trigger-source

Conversation

@nambok

@nambok nambok commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

The runs list showed <ticket id> · <repo>, so a run Coderhelm started itself read as E2E-FIX-a7f51433483adf820849, and nothing said whether a run came from Jira, GitHub, an alert, a log finding, a plan or a person in the dashboard. The runs API now sends a trigger object worked out on the server, and the list can filter on it.

Changes

  • trigger on RunSummary and Run (gateway/src/routes/run_trigger.rs): {kind, label, ref, ref_url, by}.
    • kind is one of jira, github, coderhelm, alert, plan, dashboard or chat. It is read from the run's own fields: plan_id, ticket_source, the ticket id prefix (E2E-FIX-, E2E-GEN-, LOG-, ALERT-), and requester_key (falling back to sender on older runs).
    • label, ref and ref_url give the words and the link:
      • Jira: links to <site>/browse/KEY.
      • GitHub issue: #N, linking to the issue.
      • Flaky test: "Started by Coderhelm · flaky test", linking to /tests/test?id=.
      • Log finding: linking to /logs?finding=. It is coderhelm when the automatic fix started it and dashboard when a person did.
      • Alert: the alarm's title, linking to /alerts/detail?id=.
      • Plan: the plan's title, linking to /plans/detail?id=.
      • Plugin: dashboard when a person ran it, coderhelm when a schedule or release did.
    • by is the person's name, GitHub login or email. Jira runs that stored only an account id get the name from the JIRAUSER# record. by is null for Coderhelm's own work.
    • The list reads the alert, log finding and Jira-user records with one BatchGetItem per page (100 keys per call, one retry for unprocessed keys). It reads the Jira site once, and only when the page has a Jira run. If a record can't be read, that run just has no link.
  • started_by on GET /api/runs (comma-separated kinds; unknown words are ignored). RunFilter applies it while it scans, like status and repo. LIST_ATTRS now also projects the fields kind reads.
  • Plans (worker/src/passes/plan_execute.rs, create_run_record):
    • When a task opens a GitHub issue or a Jira ticket, the worker writes PLAN_TICKET#github#owner/repo#N or PLAN_TICKET#jira#KEY in the settings table, holding the plan's id, title and the person who ran it. For GitHub this happens before the label that starts the run.
    • create_run_record copies plan_id, plan_title and plan_by onto the run.
    • If a run for that ticket already exists (the Jira webhook can arrive first), the worker updates it through ticket-index.
  • docs/api/openapi.json was regenerated (RunTrigger, TriggerKind, the started_by param).

What this leaves out:

  • Plan runs from before this change have no link, so they show as GitHub or Jira.
  • No current path starts a run from Slack or Teams. The chat kind is there for slack: and teams: requester keys, but today that filter will always be empty.
  • PR reviews are not runs in the runs table, so there is no "PR review" kind.

Verification

  • cargo fmt --check --all, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace: all pass. That includes 12 new run_trigger tests (one per kind, Jira name lookup, internal id never shown, links, filter words) and a run_search test for started_by.
  • UPDATE_OPENAPI=1 cargo test -p gateway openapi, then the committed-document check passes.
  • The dashboard PR (CoderHelm/coderhelm, branch ui/run-trigger-source) reads trigger and started_by, with e2e coverage for each kind.

The runs list and a run now carry `trigger` {kind, label, ref, ref_url, by},
worked out on the server from the run's own fields: ticket_source, the
ticket id's prefix (E2E-FIX-, E2E-GEN-, LOG-, ALERT-), requester_* or the
older sender, and the plan a ticket came from. Coderhelm's own work reads
"Started by Coderhelm · flaky test" with a link to the test instead of its
internal ticket id. Alerts and log findings link to the event and the
finding; Jira tickets to the team's site; GitHub issues to the issue.

GET /api/runs takes `started_by` (jira, github, coderhelm, alert, plan,
dashboard, chat), applied while it scans like the other filters.

Plans: when a plan's task opens a GitHub issue or a Jira ticket, the
worker records the link (settings PLAN_TICKET#...) before the label that
starts the run, copies the plan's id, title and runner onto the run it
starts, and marks a run that started first (a Jira webhook can win).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant